﻿using Batman.Cms.Core.Core.SimpleMaintenance.Enums;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System;

namespace Batman.Cms.Core.Core.SimpleMaintenance.DTO.FormField
{
    public interface IMaintenanceFormField { }

    public abstract class MaintenanceFormField : IMaintenanceFormField
    {
        public virtual string FieldName { get; set; }

        public virtual string Label { get; set; }

        public virtual object Val { get; set; }

        public virtual bool @readonly { get; set; }

        /// <summary>
        ///  搜索用
        /// </summary>
        public MaintenanceSearchBarCondition Condition { get; set; }

        [JsonConverter(typeof(StringEnumConverter))]
        public virtual MaintenanceFormFieldType Type { get { throw new NotImplementedException(); } }

        /// <summary>
        /// 隐藏
        /// </summary>
        public virtual bool Hide { get; set; }
    }

    /// <summary>
    /// 查询输入
    /// </summary>
    public class MaintenanceFormFieldInput
    {
        public string FieldName { get; set; }

        public string Val { get; set; }

        public MaintenanceSearchBarCondition Condition { get; set; }

        public virtual MaintenanceFormFieldType Type { get; set; }

    }
}
